//牛客 二维数组中的查找

#include <vector>
using namespace std;

class Solution
{
public:
    bool binarySearch(vector<int>& arr, int target)
    {
        int left = 0, right = arr.size()-1;
        while(left <= right)
        {
            int mid = left + (right-left)/2;
            if(arr[mid] > target) left = mid + 1;
            else if(arr[mid] < target) right = mid - 1;
            else return true;
        }
        return false;
    }
    bool Find(int target, vector<vector<int>>& array)
    {
        for(auto& arr : array)
        {
            if(binarySearch(i, target)) return true;
        }
        return false;
    }
};